﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace PDO.DataPersistence.Core
{
    public static class ExtendedTypes
    {
        /// <summary>
        /// Get Type corresponding to provided extended type name, or null if typeName is not an ExtendedType.
        /// </summary>
        /// <param name="name">Name of Type</param>
        /// <returns>Type or null</returns>
        public static Type GetTypeByName(string name)
        {
            // Load the extension plugins
            PersistableDataObjectPluginManager pdoManager = PersistableDataObjectPluginManager.Current();
            return pdoManager.GetTypeByName(name);
        }

        /// <summary>
        /// Get Type corresponding to provided extended type full name, or null if name is not an ExtendedType.
        /// </summary>
        /// <param name="name">Name of Type</param>
        /// <returns>Type or null</returns>
        public static Type GetTypeByFullName(string fullName)
        {
            // Load the extension plugins
            PersistableDataObjectPluginManager pdoManager = PersistableDataObjectPluginManager.Current();
            return pdoManager.GetTypeByFullName(fullName);
        }
    }
}